package com.uvnos4j.matilda.commons.dto;

import lombok.Data;

import java.util.List;

/**
 * DataTable 分页结果封装
 *
 * @param <T>
 * @author Guo.wl
 */
@Data
public class DataTable<T> {

    private int draw;

    private int recordsTotal;

    private int recordsFiltered;

    private List<T> data;

    private String error;

    public DataTable(int draw, int recordsTotal, int recordsFiltered, List<T> data) {
        this.draw = draw;
        this.recordsTotal = recordsTotal;
        this.recordsFiltered = recordsFiltered;
        this.data = data;
    }

    public DataTable(int draw, String error) {
        this.draw = draw;
        this.error = error;
    }

}